﻿using System;
using System.Collections.Generic;
using System.Net.Sockets;
using FluorineFx.AMF3;

namespace AMFNet
{
    /// <summary>
    /// 客户端连接对象
    /// </summary>
    class AMFClientSocket
    {
        public int SocketId;
        //客户端连接Socket
        public Socket ClientSocket;
        //接收缓冲区当前数据位置
        public int ReceivePosition;
        //接收缓冲区
        public byte[] ReceiveBuffer;
        //解析接收缓冲区AMF数据 
        public ByteArray FluorineFxArray;
        //打包发送数据
        public ByteArray SendArray;
        //发送队列
        public List<MessageBase> SendList;
        //发送锁
        public Object SendLock = new object();
        //是否可以发送标志
        public bool CanSend;
        public DateTime LastReceiveTime;

        public AMFClientSocket(int BufferSize)
        {
            ReceiveBuffer = new byte[BufferSize];
            FluorineFxArray = new ByteArray();
            SendArray = new ByteArray();
            SendList = new List<MessageBase>();
            CanSend = true;
        }
    }
}
